isempty();
// 为关注的少的人推荐其他文章
function judge(data) {
  if (data.transmit == 0) {
    data.transmit = "分享";
  }
  if (data.likes == 0) {
    data.likes = "点赞";
  }
  if (data.comment == 0) {
    data.comment = "评论";
  }
}
function isempty() {
  let news = document.getElementsByClassName("news");
  let allnews = document.querySelector("#news");
  console.log("没有关注的情况");
  console.log(document.querySelector("#empty"));

  if (document.querySelector("#empty")) {
    // 渲染热门微博
    $.ajax({
      url: `/weibo/blog/getTheLatestHotBlogForLogin`,
      type: "get",
      data: {},
      success: function (result) {
        console.log(result);

        for (let i = 0; i < result.length; i++) {
          judge(result[i]);
          allnews.innerHTML += `<div class="news add" uid="${result[i].uid}" bid="${result[i].id}">
        <div class="news-top">
          <a href="/weibo/user/toOnesInfo?id=${result[i].uid}" class="head-link">
            <div class="head">
              <img
                      src="${result[i].userAvatarUrl}"
                      alt=""
              />
            </div>
          </a>
          <div class="top-details">
            <a  href="/weibo/user/toOnesInfo?id=${result[i].uid}" class="name">
              <p >${result[i].username}</p>
            </a>
            <p class="time">${result[i].time}</p>
          </div>
          <div class="report-remove">
          <div class="rm-icon" bid="${result[i].id}" otherid="${result[i].uid}" onclick="reportfn(this)">
            <i class="iconfont">&#xe62e;</i>
          </div>
          <ul class="rm-detials hidden">
            <li class="tip-off-li" bid="${result[i].id}" onclick="tipOffFn(this)">
              投诉
            </li>
            <li class="remove-li" bid="${result[i].id}" onclick="removeBlog(this)">
              删除
            </li>
          </ul>
        </div>
        </div>
        <div class="news-container">
          <div  class="container">
          <a class="color" href="/blog/skipToBlog?label=${result[i].label}">#${result[i].label}#</a>&nbsp;&nbsp;
          <span class="container-text" >${result[i].text}</span>

            <span class="collapse">收起</span>
          </div>

          <div class="news-content">
          </div>
        </div>
        <!-- 底部博文功能 -->
        <div class="foot">
          <div class="share">
            <i class="iconfont">&#xe62f;</i>
            <span>${result[i].transmit}</span>
          </div>
          <div class="assess" bid="${result[i].id}">
            <i class="iconfont">&#xe695;</i>
            <span>${result[i].comment}</span>
          </div>
          <div class="store">
          <i class="iconfont">&#xe647;</i>
          <span>收藏</span>
        </div>
          <div class="like">
            <i class="iconfont">&#xe62b;</i>
            <span>${result[i].likes}</span>
          </div>
        </div>
        <!-- 点击评论展开评论信息 -->
        <div class="spread">
          <textarea
                  placeholder="请发布你的评论"
                  class="comment-text"
          ></textarea>
          <span class="comment-ddl">还可输入140字</span>
          <button class="comment-btn disable" bid="${result[i].id}">评论</button>
          <!-- 评论 -->
          <div class="comment">   
          </div>
        </div>
      </div>`;
          let add = document.getElementsByClassName("add")[i];
          let content = add.querySelector(".news-content");
          let picture = result[i].pictureUrl;
          if (picture.length > 0) {
            for (let j = 0; j < picture.length; j++) {
              content.innerHTML += `<div class="news-content-img"  >
        <img src="${picture[j]}"alt="" onclick="showModel(this)">
      </div>`;
            }
          }
        }
        if (result.length >= 0 && result.length < 10) {
          document.querySelector(".none").classList.remove("hidden");
        }
        more();
        assessBtn();
        commentfn();
        commentlimit();
        YesOrNo();
        func();
        replyWindow();
        collapsefn();
        switchover();
        reportfn();
      },
    });
  }
}
